package com.jams.goodox.activity.wallet;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by Jin on 2016/12/27.
 * Description 红包布局间隙设置
 */
public class MineWalletSpaceItemDecoration extends RecyclerView.ItemDecoration {

	private int space;

	public MineWalletSpaceItemDecoration(int space) {
		this.space = space;
	}

	@Override
	public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
		if (parent.getChildAdapterPosition(view) / 3 > 0) outRect.top = space;
		if (parent.getChildAdapterPosition(view) % 3 > 0) outRect.left = space;
	}
}